package com.ht.riskchk.domain;

/**
 * <p>工单触发源</p>
 * @author wangwb
 * @version V1.0
 */
public enum OrderTriggerEnum {
//
    outStand("外部标准",20),
    controlNew("质量控制标准新建",21),
    controlChange("质量控制标准改版",22),
    inspectNew("质量监控计划新建触发",23),
    inspectChange("质量监控计划改版触发",24),
    netContentNew("产品净含量新建触发",25),
    netContentChange("产品净含量改版触发",26),
    newMat("新增物料+工厂触发",31),
    nowMat("现有物料工厂新增工艺路线触发",32),
    stopRoute("停用工艺路线触发",33),
    stopMat("停用物料+工厂触发",34),
    monitorInspection("检验计划修改-以监控计划标准触发",35),
    newBom("新增BOM",41),
    updateBom("修改BOM",42);

    OrderTriggerEnum(String name, Integer saveType) {
        this.name = name;
        this.code = saveType;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    private String name;
    private Integer code;
    public static OrderTriggerEnum getByCode(int status){

        OrderTriggerEnum[] values = OrderTriggerEnum.values();
        for (OrderTriggerEnum value : values) {
            if(value.getCode().intValue() == status) {
                return value;
            }
        }
        return  null;
    }
}
